Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.


QTRS
  ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.

Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
FILTER(X1, mark(X2), X3) → FILTER(X1, X2, X3)
ACTIVE(filter(cons(X, Y), 0, M)) → FILTER(Y, M, M)
MARK(cons(X1, X2)) → MARK(X1)
ACTIVE(nats(N)) → CONS(N, nats(s(N)))
CONS(X1, mark(X2)) → CONS(X1, X2)
SIEVE(mark(X)) → SIEVE(X)
ACTIVE(sieve(cons(s(N), Y))) → FILTER(Y, N, N)
MARK(nats(X)) → NATS(mark(X))
FILTER(X1, X2, mark(X3)) → FILTER(X1, X2, X3)
NATS(mark(X)) → NATS(X)
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
ACTIVE(zprimes) → S(0)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
S(active(X)) → S(X)
ACTIVE(sieve(cons(s(N), Y))) → CONS(s(N), sieve(filter(Y, N, N)))
MARK(cons(X1, X2)) → CONS(mark(X1), X2)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(filter(X1, X2, X3)) → FILTER(mark(X1), mark(X2), mark(X3))
ACTIVE(sieve(cons(0, Y))) → SIEVE(Y)
ACTIVE(zprimes) → SIEVE(nats(s(s(0))))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(filter(X1, X2, X3)) → MARK(X2)
CONS(active(X1), X2) → CONS(X1, X2)
ACTIVE(zprimes) → S(s(0))
ACTIVE(zprimes) → NATS(s(s(0)))
ACTIVE(zprimes) → MARK(sieve(nats(s(s(0)))))
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))
CONS(mark(X1), X2) → CONS(X1, X2)
ACTIVE(filter(cons(X, Y), s(N), M)) → FILTER(Y, N, M)
MARK(s(X)) → MARK(X)
NATS(active(X)) → NATS(X)
ACTIVE(nats(N)) → NATS(s(N))
FILTER(X1, active(X2), X3) → FILTER(X1, X2, X3)
ACTIVE(filter(cons(X, Y), s(N), M)) → CONS(X, filter(Y, N, M))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
CONS(X1, active(X2)) → CONS(X1, X2)
MARK(s(X)) → ACTIVE(s(mark(X)))
MARK(nats(X)) → MARK(X)
SIEVE(active(X)) → SIEVE(X)
MARK(zprimes) → ACTIVE(zprimes)
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(filter(cons(X, Y), 0, M)) → CONS(0, filter(Y, M, M))
ACTIVE(sieve(cons(0, Y))) → CONS(0, sieve(Y))
FILTER(X1, X2, active(X3)) → FILTER(X1, X2, X3)
S(mark(X)) → S(X)
MARK(s(X)) → S(mark(X))
MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(cons(X1, X2)) → ACTIVE(cons(mark(X1), X2))
FILTER(active(X1), X2, X3) → FILTER(X1, X2, X3)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
MARK(sieve(X)) → SIEVE(mark(X))
FILTER(mark(X1), X2, X3) → FILTER(X1, X2, X3)
ACTIVE(sieve(cons(s(N), Y))) → SIEVE(filter(Y, N, N))
MARK(0) → ACTIVE(0)
ACTIVE(nats(N)) → S(N)
MARK(sieve(X)) → MARK(X)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ DependencyPairsProof
QDP
      ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
FILTER(X1, mark(X2), X3) → FILTER(X1, X2, X3)
ACTIVE(filter(cons(X, Y), 0, M)) → FILTER(Y, M, M)
MARK(cons(X1, X2)) → MARK(X1)
ACTIVE(nats(N)) → CONS(N, nats(s(N)))
CONS(X1, mark(X2)) → CONS(X1, X2)
SIEVE(mark(X)) → SIEVE(X)
ACTIVE(sieve(cons(s(N), Y))) → FILTER(Y, N, N)
MARK(nats(X)) → NATS(mark(X))
FILTER(X1, X2, mark(X3)) → FILTER(X1, X2, X3)
NATS(mark(X)) → NATS(X)
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
ACTIVE(zprimes) → S(0)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
S(active(X)) → S(X)
ACTIVE(sieve(cons(s(N), Y))) → CONS(s(N), sieve(filter(Y, N, N)))
MARK(cons(X1, X2)) → CONS(mark(X1), X2)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(filter(X1, X2, X3)) → FILTER(mark(X1), mark(X2), mark(X3))
ACTIVE(sieve(cons(0, Y))) → SIEVE(Y)
ACTIVE(zprimes) → SIEVE(nats(s(s(0))))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(filter(X1, X2, X3)) → MARK(X2)
CONS(active(X1), X2) → CONS(X1, X2)
ACTIVE(zprimes) → S(s(0))
ACTIVE(zprimes) → NATS(s(s(0)))
ACTIVE(zprimes) → MARK(sieve(nats(s(s(0)))))
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))
CONS(mark(X1), X2) → CONS(X1, X2)
ACTIVE(filter(cons(X, Y), s(N), M)) → FILTER(Y, N, M)
MARK(s(X)) → MARK(X)
NATS(active(X)) → NATS(X)
ACTIVE(nats(N)) → NATS(s(N))
FILTER(X1, active(X2), X3) → FILTER(X1, X2, X3)
ACTIVE(filter(cons(X, Y), s(N), M)) → CONS(X, filter(Y, N, M))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
CONS(X1, active(X2)) → CONS(X1, X2)
MARK(s(X)) → ACTIVE(s(mark(X)))
MARK(nats(X)) → MARK(X)
SIEVE(active(X)) → SIEVE(X)
MARK(zprimes) → ACTIVE(zprimes)
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(filter(cons(X, Y), 0, M)) → CONS(0, filter(Y, M, M))
ACTIVE(sieve(cons(0, Y))) → CONS(0, sieve(Y))
FILTER(X1, X2, active(X3)) → FILTER(X1, X2, X3)
S(mark(X)) → S(X)
MARK(s(X)) → S(mark(X))
MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(cons(X1, X2)) → ACTIVE(cons(mark(X1), X2))
FILTER(active(X1), X2, X3) → FILTER(X1, X2, X3)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
MARK(sieve(X)) → SIEVE(mark(X))
FILTER(mark(X1), X2, X3) → FILTER(X1, X2, X3)
ACTIVE(sieve(cons(s(N), Y))) → SIEVE(filter(Y, N, N))
MARK(0) → ACTIVE(0)
ACTIVE(nats(N)) → S(N)
MARK(sieve(X)) → MARK(X)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 6 SCCs with 22 less nodes.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

NATS(mark(X)) → NATS(X)
NATS(active(X)) → NATS(X)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

NATS(mark(X)) → NATS(X)
NATS(active(X)) → NATS(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

SIEVE(active(X)) → SIEVE(X)
SIEVE(mark(X)) → SIEVE(X)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

SIEVE(active(X)) → SIEVE(X)
SIEVE(mark(X)) → SIEVE(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

S(mark(X)) → S(X)
S(active(X)) → S(X)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

S(active(X)) → S(X)
S(mark(X)) → S(X)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

CONS(X1, active(X2)) → CONS(X1, X2)
CONS(mark(X1), X2) → CONS(X1, X2)
CONS(active(X1), X2) → CONS(X1, X2)
CONS(X1, mark(X2)) → CONS(X1, X2)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

CONS(mark(X1), X2) → CONS(X1, X2)
CONS(X1, active(X2)) → CONS(X1, X2)
CONS(X1, mark(X2)) → CONS(X1, X2)
CONS(active(X1), X2) → CONS(X1, X2)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ UsableRulesProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

FILTER(active(X1), X2, X3) → FILTER(X1, X2, X3)
FILTER(X1, mark(X2), X3) → FILTER(X1, X2, X3)
FILTER(X1, active(X2), X3) → FILTER(X1, X2, X3)
FILTER(X1, X2, active(X3)) → FILTER(X1, X2, X3)
FILTER(X1, X2, mark(X3)) → FILTER(X1, X2, X3)
FILTER(mark(X1), X2, X3) → FILTER(X1, X2, X3)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ UsableRulesProof
QDP
                ↳ QDPSizeChangeProof
          ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

FILTER(X1, mark(X2), X3) → FILTER(X1, X2, X3)
FILTER(active(X1), X2, X3) → FILTER(X1, X2, X3)
FILTER(X1, active(X2), X3) → FILTER(X1, X2, X3)
FILTER(X1, X2, mark(X3)) → FILTER(X1, X2, X3)
FILTER(X1, X2, active(X3)) → FILTER(X1, X2, X3)
FILTER(mark(X1), X2, X3) → FILTER(X1, X2, X3)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
QDP
            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(cons(X1, X2)) → ACTIVE(cons(mark(X1), X2))
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(s(X)) → ACTIVE(s(mark(X)))
MARK(nats(X)) → MARK(X)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(zprimes) → ACTIVE(zprimes)
MARK(sieve(X)) → MARK(X)
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(zprimes) → MARK(sieve(nats(s(s(0)))))
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MARK(cons(X1, X2)) → ACTIVE(cons(mark(X1), X2))
MARK(s(X)) → ACTIVE(s(mark(X)))
The remaining pairs can at least be oriented weakly.

MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(nats(X)) → MARK(X)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(zprimes) → ACTIVE(zprimes)
MARK(sieve(X)) → MARK(X)
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(zprimes) → MARK(sieve(nats(s(s(0)))))
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(0) = 0   
POL(ACTIVE(x1)) = x1   
POL(MARK(x1)) = 1   
POL(active(x1)) = 0   
POL(cons(x1, x2)) = 0   
POL(filter(x1, x2, x3)) = 1   
POL(mark(x1)) = 0   
POL(nats(x1)) = 1   
POL(s(x1)) = 0   
POL(sieve(x1)) = 1   
POL(zprimes) = 1   

The following usable rules [17] were oriented:

nats(active(X)) → nats(X)
nats(mark(X)) → nats(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
s(active(X)) → s(X)
s(mark(X)) → s(X)
cons(X1, active(X2)) → cons(X1, X2)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
QDP
                ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(nats(X)) → MARK(X)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(sieve(X)) → MARK(X)
MARK(zprimes) → ACTIVE(zprimes)
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))
ACTIVE(zprimes) → MARK(sieve(nats(s(s(0)))))

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


ACTIVE(zprimes) → MARK(sieve(nats(s(s(0)))))
The remaining pairs can at least be oriented weakly.

MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(nats(X)) → MARK(X)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(sieve(X)) → MARK(X)
MARK(zprimes) → ACTIVE(zprimes)
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(ACTIVE(x1)) = x1   
POL(MARK(x1)) = x1   
POL(active(x1)) = x1   
POL(cons(x1, x2)) = x1   
POL(filter(x1, x2, x3)) = x1 + x2 + x3   
POL(mark(x1)) = x1   
POL(nats(x1)) = x1   
POL(s(x1)) = x1   
POL(sieve(x1)) = x1   
POL(zprimes) = 1   

The following usable rules [17] were oriented:

nats(active(X)) → nats(X)
nats(mark(X)) → nats(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
active(nats(N)) → mark(cons(N, nats(s(N))))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(nats(X)) → active(nats(mark(X)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
mark(s(X)) → active(s(mark(X)))
mark(zprimes) → active(zprimes)
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
mark(sieve(X)) → active(sieve(mark(X)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
mark(0) → active(0)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
s(active(X)) → s(X)
s(mark(X)) → s(X)
cons(X1, active(X2)) → cons(X1, X2)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
QDP
                    ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(nats(X)) → MARK(X)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(zprimes) → ACTIVE(zprimes)
MARK(sieve(X)) → MARK(X)
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
QDP
                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(nats(X)) → MARK(X)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(sieve(X)) → MARK(X)
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


ACTIVE(sieve(cons(0, Y))) → MARK(cons(0, sieve(Y)))
MARK(sieve(X)) → MARK(X)
ACTIVE(sieve(cons(s(N), Y))) → MARK(cons(s(N), sieve(filter(Y, N, N))))
The remaining pairs can at least be oriented weakly.

MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(nats(X)) → MARK(X)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(filter(X1, X2, X3)) → MARK(X1)
Used ordering: Polynomial interpretation [25]:

POL(0) = 0   
POL(ACTIVE(x1)) = x1   
POL(MARK(x1)) = x1   
POL(active(x1)) = x1   
POL(cons(x1, x2)) = x1   
POL(filter(x1, x2, x3)) = x1 + x2 + x3   
POL(mark(x1)) = x1   
POL(nats(x1)) = x1   
POL(s(x1)) = x1   
POL(sieve(x1)) = 1 + x1   
POL(zprimes) = 1   

The following usable rules [17] were oriented:

nats(active(X)) → nats(X)
nats(mark(X)) → nats(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
active(nats(N)) → mark(cons(N, nats(s(N))))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(nats(X)) → active(nats(mark(X)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
mark(s(X)) → active(s(mark(X)))
mark(zprimes) → active(zprimes)
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
mark(sieve(X)) → active(sieve(mark(X)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
mark(0) → active(0)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
s(active(X)) → s(X)
s(mark(X)) → s(X)
cons(X1, active(X2)) → cons(X1, X2)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(s(X)) → MARK(X)
MARK(filter(X1, X2, X3)) → MARK(X3)
MARK(nats(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MARK(filter(X1, X2, X3)) → MARK(X2)
MARK(filter(X1, X2, X3)) → MARK(X3)
ACTIVE(filter(cons(X, Y), 0, M)) → MARK(cons(0, filter(Y, M, M)))
MARK(filter(X1, X2, X3)) → MARK(X1)
ACTIVE(filter(cons(X, Y), s(N), M)) → MARK(cons(X, filter(Y, N, M)))
The remaining pairs can at least be oriented weakly.

MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(s(X)) → MARK(X)
MARK(nats(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(0) = 0   
POL(ACTIVE(x1)) = x1   
POL(MARK(x1)) = x1   
POL(active(x1)) = x1   
POL(cons(x1, x2)) = x1   
POL(filter(x1, x2, x3)) = 1 + x1 + x2 + x3   
POL(mark(x1)) = x1   
POL(nats(x1)) = x1   
POL(s(x1)) = x1   
POL(sieve(x1)) = x1   
POL(zprimes) = 0   

The following usable rules [17] were oriented:

nats(active(X)) → nats(X)
nats(mark(X)) → nats(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
active(nats(N)) → mark(cons(N, nats(s(N))))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(nats(X)) → active(nats(mark(X)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
mark(s(X)) → active(s(mark(X)))
mark(zprimes) → active(zprimes)
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
mark(sieve(X)) → active(sieve(mark(X)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
mark(0) → active(0)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
s(active(X)) → s(X)
s(mark(X)) → s(X)
cons(X1, active(X2)) → cons(X1, X2)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ QDPOrderProof
QDP
                                ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(nats(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MARK(sieve(X)) → ACTIVE(sieve(mark(X)))
MARK(filter(X1, X2, X3)) → ACTIVE(filter(mark(X1), mark(X2), mark(X3)))
The remaining pairs can at least be oriented weakly.

ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(nats(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(0) = 0   
POL(ACTIVE(x1)) = x1   
POL(MARK(x1)) = 1   
POL(active(x1)) = 0   
POL(cons(x1, x2)) = 0   
POL(filter(x1, x2, x3)) = 0   
POL(mark(x1)) = 0   
POL(nats(x1)) = 1   
POL(s(x1)) = 0   
POL(sieve(x1)) = 0   
POL(zprimes) = 0   

The following usable rules [17] were oriented:

nats(active(X)) → nats(X)
nats(mark(X)) → nats(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ QDPOrderProof
                              ↳ QDP
                                ↳ QDPOrderProof
QDP
                                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(s(X)) → MARK(X)
MARK(nats(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(cons(X1, X2)) → MARK(X1)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


ACTIVE(nats(N)) → MARK(cons(N, nats(s(N))))
MARK(nats(X)) → MARK(X)
The remaining pairs can at least be oriented weakly.

MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(cons(X1, X2)) → MARK(X1)
Used ordering: Polynomial interpretation with max and min functions [25]:

POL(0) = 0   
POL(ACTIVE(x1)) = x1   
POL(MARK(x1)) = x1   
POL(active(x1)) = x1   
POL(cons(x1, x2)) = x1   
POL(filter(x1, x2, x3)) = 1 + x1 + x3   
POL(mark(x1)) = x1   
POL(nats(x1)) = 1 + x1   
POL(s(x1)) = x1   
POL(sieve(x1)) = x1   
POL(zprimes) = 1   

The following usable rules [17] were oriented:

filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
nats(active(X)) → nats(X)
nats(mark(X)) → nats(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
active(nats(N)) → mark(cons(N, nats(s(N))))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(nats(X)) → active(nats(mark(X)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
mark(s(X)) → active(s(mark(X)))
mark(zprimes) → active(zprimes)
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
mark(sieve(X)) → active(sieve(mark(X)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
s(active(X)) → s(X)
s(mark(X)) → s(X)
mark(0) → active(0)
cons(X1, active(X2)) → cons(X1, X2)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)



↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ QDPOrderProof
                              ↳ QDP
                                ↳ QDPOrderProof
                                  ↳ QDP
                                    ↳ QDPOrderProof
QDP
                                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

MARK(s(X)) → MARK(X)
MARK(nats(X)) → ACTIVE(nats(mark(X)))
MARK(cons(X1, X2)) → MARK(X1)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ QDPOrderProof
                              ↳ QDP
                                ↳ QDPOrderProof
                                  ↳ QDP
                                    ↳ QDPOrderProof
                                      ↳ QDP
                                        ↳ DependencyGraphProof
QDP
                                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)

The TRS R consists of the following rules:

active(filter(cons(X, Y), 0, M)) → mark(cons(0, filter(Y, M, M)))
active(filter(cons(X, Y), s(N), M)) → mark(cons(X, filter(Y, N, M)))
active(sieve(cons(0, Y))) → mark(cons(0, sieve(Y)))
active(sieve(cons(s(N), Y))) → mark(cons(s(N), sieve(filter(Y, N, N))))
active(nats(N)) → mark(cons(N, nats(s(N))))
active(zprimes) → mark(sieve(nats(s(s(0)))))
mark(filter(X1, X2, X3)) → active(filter(mark(X1), mark(X2), mark(X3)))
mark(cons(X1, X2)) → active(cons(mark(X1), X2))
mark(0) → active(0)
mark(s(X)) → active(s(mark(X)))
mark(sieve(X)) → active(sieve(mark(X)))
mark(nats(X)) → active(nats(mark(X)))
mark(zprimes) → active(zprimes)
filter(mark(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, mark(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, mark(X3)) → filter(X1, X2, X3)
filter(active(X1), X2, X3) → filter(X1, X2, X3)
filter(X1, active(X2), X3) → filter(X1, X2, X3)
filter(X1, X2, active(X3)) → filter(X1, X2, X3)
cons(mark(X1), X2) → cons(X1, X2)
cons(X1, mark(X2)) → cons(X1, X2)
cons(active(X1), X2) → cons(X1, X2)
cons(X1, active(X2)) → cons(X1, X2)
s(mark(X)) → s(X)
s(active(X)) → s(X)
sieve(mark(X)) → sieve(X)
sieve(active(X)) → sieve(X)
nats(mark(X)) → nats(X)
nats(active(X)) → nats(X)

Q is empty.
We have to consider all minimal (P,Q,R)-chains.
We can use the usable rules and reduction pair processor [15] with the Ce-compatible extension of the polynomial order that maps every function symbol to the sum of its argument. Then, we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ DependencyPairsProof
    ↳ QDP
      ↳ DependencyGraphProof
        ↳ AND
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
          ↳ QDP
            ↳ QDPOrderProof
              ↳ QDP
                ↳ QDPOrderProof
                  ↳ QDP
                    ↳ DependencyGraphProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ QDPOrderProof
                              ↳ QDP
                                ↳ QDPOrderProof
                                  ↳ QDP
                                    ↳ QDPOrderProof
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
QDP
                                                ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

MARK(s(X)) → MARK(X)
MARK(cons(X1, X2)) → MARK(X1)

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: